import Vue from 'vue';
import Router from 'vue-router';
import Login from '@/views/Login.vue';
import Register from '@/views/Register.vue';
import Home from '@/views/Home.vue';
import UserCenter from '@/views/UserCenter.vue';
import OrderList from '@/views/OrderList.vue';
import Repair from '@/views/Repair.vue';
import CarInfo from '@/views/CarInfo.vue';
import Recharge from '@/views/Recharge.vue';
import Appointment from '@/views/Appointment.vue';
import AppointmentCode from '@/views/AppointmentCode.vue';
import AppointmentSign from '@/views/AppointmentSign.vue';
import Coupon from '@/views/Coupon.vue';
import Refund from '@/views/Refund.vue';
import Statistics from '@/views/Statistics.vue';
import NotFound from '@/views/NotFound.vue';
// 管理端
import AdminDashboard from '@/views/admin/AdminDashboard.vue';
import UserManage from '@/views/admin/UserManage.vue';
import RepairManage from '@/views/admin/RepairManage.vue';
import FeeManage from '@/views/admin/FeeManage.vue';
import PileManage from '@/views/admin/PileManage.vue';
import StationManage from '@/views/admin/StationManage.vue';
import FlowStatistics from '@/views/admin/FlowStatistics.vue';
import ViolationStatistics from '@/views/admin/ViolationStatistics.vue';
import PriceManage from '@/views/admin/PriceManage.vue';
import CouponManage from '@/views/admin/CouponManage.vue';
import MobilePileApply from '@/views/admin/MobilePileApply.vue';
import InspectionManage from '@/views/admin/InspectionManage.vue';

Vue.use(Router);

export default new Router({
  mode: 'history',
  routes: [
    { path: '/', redirect: '/login' },
    { path: '/login', component: Login },
    { path: '/register', component: Register },
    { path: '/home', component: Home },
    { path: '/user', component: UserCenter },
    { path: '/car', component: CarInfo },
    { path: '/recharge', component: Recharge },
    { path: '/orders', component: OrderList },
    { path: '/repair', component: Repair },
    { path: '/appointment', component: Appointment },
    { path: '/appointment-code', component: AppointmentCode },
    { path: '/appointment-sign', component: AppointmentSign },
    { path: '/coupon', component: Coupon },
    { path: '/refund', component: Refund },
    { path: '/statistics', component: Statistics },
    // 管理端
    { path: '/admin', component: AdminDashboard },
    { path: '/admin/user', component: UserManage },
    { path: '/admin/repair', component: RepairManage },
    { path: '/admin/fee', component: FeeManage },
    { path: '/admin/pile', component: PileManage },
    { path: '/admin/station', component: StationManage },
    { path: '/admin/flow', component: FlowStatistics },
    { path: '/admin/violation', component: ViolationStatistics },
    { path: '/admin/price', component: PriceManage },
    { path: '/admin/coupon', component: CouponManage },
    { path: '/admin/mobile-pile', component: MobilePileApply },
    { path: '/admin/inspection', component: InspectionManage },
    { path: '*', component: NotFound }
  ]
});
